<template>
  <div class="custom-form" style="background-color: white;">
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px"
        :key="showFormKey" v-if="showForm">
        <el-col :span="24" __isInput__="hasFormPermission('field100e65e')">
          <el-form-item :label="$t('产品类型')" prop="field100e65e">
            <el-select v-model="formData['field100e65e']" placeholder="请选择产品类型"
              __isDisabled__="hasDisabledPermission('field100e65e',false)" filterable clearable
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in field100e65eOptions" :key="index" :label="item.F_ModelName"
                :value="item.F_Id" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isInput__="hasFormPermission('field10115ed')">
          <el-form-item :label="$t('关键词')" prop="field10115ed">
            <el-input v-model="formData['field10115ed']" type="textarea" placeholder="请输入关键词（多个以英文逗号分隔）"
              __isDisabled__="hasDisabledPermission('field10115ed',false)"
              __isReadonly__="!hasEditPermission('field10115ed',false)" :autosize="{minRows: 4, maxRows: 4}"
              :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6" __isInput__="hasFormPermission('field102f7a2')">
          <el-form-item :label="$t('生成数量')" prop="field102f7a2">
            <el-slider __isDisabled__="hasDisabledPermission('field102f7a2',false)"
              __isReadonly__="!hasEditPermission('field102f7a2',undefined)" :min='1' :max='4' :step='1'
              v-model="formData['field102f7a2']"></el-slider>
          </el-form-item>
		  <el-form-item :label="$t('分辨率')" prop="field104ed68">
		    <el-radio-group v-model="formData['field104ed68']" size="mini"
		      __isDisabled__="hasDisabledPermission('field104ed68',false)"
		      __isReadonly__="!hasEditPermission('field104ed68',undefined)">
		      <el-radio-button v-for="(item, index) in field104ed68Options" :key="index"
		        :label="item.F_ItemValue" :disabled="item.disabled" border>{{item.F_ItemName}}
		      </el-radio-button>
		    </el-radio-group>
		  </el-form-item>
        </el-col>
        <el-col :span="10" __isInput__="hasFormPermission('field105846a')">
          <el-form-item :label="$t('宽度')" prop="field105846a">
            <el-slider __isDisabled__="hasDisabledPermission('field105846a',false)"
              __isReadonly__="!hasEditPermission('field105846a',undefined)" :min='64' :max='2048' :step='1'
              v-model="formData['field105846a']"></el-slider>
          </el-form-item>
          <el-form-item :label="$t('高度')" prop="field1065b12">
            <el-slider __isDisabled__="hasDisabledPermission('field1065b12',false)"
              __isReadonly__="!hasEditPermission('field1065b12',undefined)" :min='64' :max='2048' :step='1'
              v-model="formData['field1065b12']"></el-slider>
          </el-form-item>
        </el-col>
        <el-col :span="8" __isOnlyLookInput__="hasLookFormPermission('field1076d78')">
          <el-form-item label-width="0" prop="field1076d78">
            <el-button type="primary" @click='getField107Options()'><i class='el-icon-star-on'></i>生成
            </el-button>
			<el-button type="primary" @click='getField108Options()'><i class='el-icon-delete-solid'></i>清空
			</el-button>
          </el-form-item>
        </el-col>
        <el-col :span="24" __isOnlyLookInput__="hasLookFormPermission('field109ec1a')">
          <el-form-item label-width="0" prop="field109ec1a">
            <div style="border-top: 1px solid #dcdfe6;margin-top: 0px;margin-bottom: 0px;"></div>
          </el-form-item>
        </el-col>
        <el-col :span="6" __isOnlyLookInput__="hasLookFormPermission('field110557f')">
          <el-form-item label-width="0" prop="field110557f">
            <h2 align='center' style="color:undefined;font-size: 15px;text-align: center"
              :style="{width: '100%'}">方案1</h2>
          </el-form-item>
        </el-col>
        <el-col :span="6" __isOnlyLookInput__="hasLookFormPermission('field1117c0b')">
          <el-form-item label-width="0" prop="field1117c0b">
            <h2 align='center' style="color:undefined;font-size: 15px;text-align: center"
              :style="{width: '100%'}">方案2</h2>
          </el-form-item>
        </el-col>
        <el-col :span="6" __isOnlyLookInput__="hasLookFormPermission('field1186552')">
          <el-form-item label-width="0" prop="field1186552">
            <h2 align='center' style="color:undefined;font-size: 15px;text-align: center"
              :style="{width: '100%'}">方案3</h2>
          </el-form-item>
        </el-col>
        <el-col :span="6" __isOnlyLookInput__="hasLookFormPermission('field119af6a')">
          <el-form-item label-width="0" prop="field119af6a">
            <h2 align='center' style="color:undefined;font-size: 15px;text-align: center"
              :style="{width: '100%'}">方案4</h2>
          </el-form-item>
        </el-col>
        <el-col :span="6" __isInput__="hasFormPermission('field1175c53')">
          <el-form-item label-width="0" prop="field1175c53">
            <el-image __isDisabled__="hasDisabledPermission('field1175c53',undefined)"
              __isReadonly__="!hasEditPermission('field1175c53',undefined)" :style="{width: '100%'}"
              :src='formData.field1175c53'>
              <div slot="error" class="image-slot"><i class="el-icon-picture-outline"></i></div>
            </el-image>
          </el-form-item>
        </el-col>
        <el-col :span="6" __isInput__="hasFormPermission('field1209f91')">
          <el-form-item label-width="0" prop="field1209f91">
            <el-image __isDisabled__="hasDisabledPermission('field1209f91',undefined)"
              __isReadonly__="!hasEditPermission('field1209f91',undefined)" :style="{width: '100%'}"
              :src='formData.field1209f91'>
              <div slot="error" class="image-slot"><i class="el-icon-picture-outline"></i></div>
            </el-image>
          </el-form-item>
        </el-col>
        <el-col :span="6" __isInput__="hasFormPermission('field12155fd')">
          <el-form-item label-width="0" prop="field12155fd">
            <el-image __isDisabled__="hasDisabledPermission('field12155fd',undefined)"
              __isReadonly__="!hasEditPermission('field12155fd',undefined)" :style="{width: '100%'}"
              :src='formData.field12155fd'>
              <div slot="error" class="image-slot"><i class="el-icon-picture-outline"></i></div>
            </el-image>
          </el-form-item>
        </el-col>
        <el-col :span="6" __isInput__="hasFormPermission('field12314e3')">
          <el-form-item label-width="0" prop="field12314e3">
            <el-image __isDisabled__="hasDisabledPermission('field12314e3',undefined)"
              __isReadonly__="!hasEditPermission('field12314e3',undefined)" :style="{width: '100%'}"
              :src='formData.field12314e3'>
              <div slot="error" class="image-slot"><i class="el-icon-picture-outline"></i></div>
            </el-image>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>
export default {
  components: {},
  props: ['keyValue', 'isEdit', 'disabled'],
  data() {
    return {
      userInfo: {},
      submitLoading: false,
      showForm: true,
      showFormKey: 1,
      reRenderSubform: false,
      operationVal: 'add',
      isAdd: true,
      //_FORM_ADDRESS_URL_,
      autoCompleteConfEventData: [],
      mainTableName: 'table0',
      formConfig: {},
      formFieldsMap: new Map(),
      hideComponentsMap: new Map(),
      needShowValueTags: ['asso-popup', 'mutiple-popup'],
      formData: {
        'field100e65e': '',
        'field10115ed': '',
        'field102f7a2': 1,
        'field105846a': 512,
        'field1076d78': '',
        'field104ed68': "0",
        'field1065b12': 512,
        'field108df02': '',
        'field109ec1a': '',
        'field110557f': '',
        'field1117c0b': '',
        'field1186552': '',
        'field119af6a': '',
        'field1175c53': "",
        'field1209f91': "",
        'field12155fd': "",
        'field12314e3': "",
      },
      rules: {
        field100e65e: [{
          required: true,
          message: '请选择产品类型',
          trigger: 'change'
        }],
        field10115ed: [],
        field104ed68: [{
          required: true,
          message: '分辨率不能为空',
          trigger: 'change'
        }],
      },
      field100e65eOptions: [],
      field104ed68Options: [],
    }
  },
  computed: {},
  watch: {},
  async created() {
    this.formConfig = this.getFormConfig();
    this.formFieldsMap = this.getFormFieldsMap();
    this.userInfo = localStorage.getItem("avue-userInfo") ? JSON.parse(localStorage.getItem(
      "avue-userInfo")).content : {};
  },
  async mounted() {
    this.hideComponentsMap = await this.getHideComponentsMap();
    this.showForm = false;
    await this.insertCreatedEvent();
    //TODO   再这里做数据回填 请求表单数据
    //用于占位
    if (typeof this.getField100Options == "function") {
      await this.getField100Options();
    }
    if (typeof this.getField104Options == "function") {
      await this.getField104Options();
    }
    await this.insertMountedEvent();
    this.reRenderSubform = true; //子表单显示
    this.showFormKey++;
    this.processParameterAssignment();
    this.showForm = true;
  },
  methods: {
    getFormData() {
      let key = this.mainTableName + 'Entity';
      let returnParams = {};
      returnParams[key] = this.formData;
      return {
        ...returnParams,
      };
    },
    validateForm() {
      this.$refs['elForm'].validate(valid => {});
    },
    async aysncValidateForm() {
      let validataArry = []
      let formValidateNotice = function formValidateNotice(obj, that, formAuth) {
        for (var o in obj) {
          if (!formAuth[o] && obj[o][0]) {
            that.$message({
              message: obj[o][0].message + ',' + that.$t('noFormAuth'),
              type: 'warning'
            });
            return;
          }
        }
      }
      validataArry.push(new Promise((resolve, reject) => {
        this.$refs['elForm'].validate((valid, object) => {
          if (!this.isWorkflowForm) formValidateNotice(object, this, this.formEnCodeList)
          resolve(valid)
        })
      }))
      let res = await Promise.all(validataArry)
      if (res.includes(false)) {
        return false
      }
      else {
        return true;
      }
    },
    changeTableData() {},
    async submitForm() {
      this.submitLoading = true;
      let valid = await this.aysncValidateForm();
      if (valid == false) {
        this.submitLoading = false;
        return false;
      }
      this.changeTableData();
      //格式化数据
      let newObj = this.getFormData();
      //此处用于占位  最后生成 替换  请勿 修改/删除
      console.log(newObj)
      //FORM_EVENT_SUBMIT
    },
    cancelForm() {
      this.$emit("onChange", true)
    },
    formatTree(data, valueField, lableField, childField, type) {
      let tree = [];
      data.forEach((node, index) => {
        let newNode = {
          value: node[valueField],
          label: node[lableField],
        };
        if (type) {
          newNode.disabled = node[valueField] == undefined ? true : false
        }
        tree.push(newNode);
        if (node[childField] != null && node[childField].length > 0) {
          newNode.children = (this.formatTree(node[childField], valueField, lableField, childField,
          type));
        }
      }, this);
      return tree;
    },
    //__WORKFLOWFORMHANDLEMETHODS__
    //FORM_EVENT_EDIT
    //__SUMIBTHANDLEMETHODS__
    async getField100Options() {
      // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
      try {
        let resp = await this.$axios({
          method: 'get',
          url: 'http://localhost:28281/data-sources/80d3178d3eaba4723c100b239d661afe/data',
        });
        let {
          data
        } = resp.data;
        let tempData = [];
        if (data && data.length > 0) {
          tempData = data.map(ele => {
            if ('F_Id') {
              ele['F_Id'] = ele['F_Id'] + '';
            }
            return ele
          });
        }
        this.field100e65eOptions = tempData
      }
      catch (error) {}
    },
    async getField107Options() {
      // 注意 this.$axios是通过Vue.prototype.$axios = axios挂载产生的
      try {}
      catch (error) {}
    },
    async getField104Options() {
      // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
      try {
        let resp = await this.$axios({
          method: 'get',
          url: 'http://localhost:28281/data-items/ResolvingPower/detail',
        });
        if (resp.data.data) {
          this.field104ed68Options = resp.data.data;
        }
      }
      catch (error) {}
    },
    async getField108Options() {
      // 注意 this.$axios是通过Vue.prototype.$axios = axios挂载产生的
      try {}
      catch (error) {}
    },
    async triggerEventHandler(eventData) {
      if (eventData.length > 0) {
        eventData.forEach(ele => {
          let functionName = 'getField' + ele.componentFormId + 'Options';
          if (typeof this[functionName] == "function") {
            this[functionName]();
          }
        })
      }
    },
    triggerEventFormIdHandler(formId) {
      if (this.formFieldsMap.get(formId).__config__.triggerEvents && this.formFieldsMap.get(formId).__config__
        .triggerEvents.length > 0) {
        this.formFieldsMap.get(formId).__config__.triggerEvents.forEach(triggerEventItem => {
          if (this.formFieldsMap.get(formId).__config__.triggerEventData && this.formFieldsMap.get(formId)
            .__config__.triggerEventData[triggerEventItem] && this.formFieldsMap.get(formId).__config__
            .triggerEventData[triggerEventItem].length > 0) {
            this.triggerEventHandler(this.formFieldsMap.get(formId).__config__.triggerEventData[
              triggerEventItem]);
          }
        });
      }
      return true;
    },
    //清空联想弹层、多选弹层的值
    clearBombLayerFormData(filed) {
      this.formData[filed] = '';
      this.formData[filed + '_showValue'] = '';
    },
    // 流程参数赋值
    processParameterAssignment() {
      // 流程中的流程参数赋值 优先级最高，最后赋值
      setTimeout(() => {
        if (this.isEdit != 2 && this.parameter && this.parameter[this.mainTableName]) {
          this.showForm = false;
          for (let [key, value] of Object.entries(this.parameter[this.mainTableName])) {
            this.setFormDataValue(key, value);
          }
          this.showForm = true;
        }
      }, 0);
    },
    setFormDataValue(field, val) {
      if (Array.isArray(this.formData[field])) {
        if (val.includes(',')) {
          this.formData[field] = val.split(',');
        }
        else {
          this.formData[field] = [val];
        }
      }
      else {
        this.formData[field] = val;
      }
      //处理联想弹层，多选弹层
      if (this.formData[field + '_showValue'] != undefined) {
        this.formData[field + '_showValue'] = val;
      }
    },
    setOutputsValue(nodeType, formId, res, outputKey) {
      let nodeTypeChecked = false;
      if (nodeType == 'created') {
        nodeTypeChecked = this.operationVal == 'add';
      }
      else if (nodeType == 'edit') {
        nodeTypeChecked = this.operationVal == 'edit';
      }
      else if (nodeType == 'mounted') {
        nodeTypeChecked = this.operationVal == 'add' || this.operationVal == 'edit';
      }
      if (nodeTypeChecked && this.disabled != true && res && res.data && res.data.data && this.formFieldsMap
        .has(formId) && this.formFieldsMap.get(formId).__vModel__ && this.formData.hasOwnProperty(this
          .formFieldsMap.get(formId).__vModel__)) {
        this.setFormDataValue(this.formFieldsMap.get(formId).__vModel__, res.data.data[outputKey]);
        // 联想弹层 多选弹层 特殊处理
        if (this.formFieldsMap.get(formId).__config__ && this.formFieldsMap.get(formId).__config__.avueType &&
          this.needShowValueTags.includes(this.formFieldsMap.get(formId).__config__.avueType)) {
          this.formData[this.formFieldsMap.get(formId).__vModel__ + '_showValue'] = res.data.data[outputKey];
        }
        this.triggerEventFormIdHandler(formId);
      }
    },
    //子表单权限
    getAuthorityTableChildrenList(bindTable, children) {
      let column = [];
      if (bindTable && this.formEnCodeList && this.formEnCodeList[bindTable]) {
        let formSubEnCodeList = this.formEnCodeList[bindTable];
        if (children && children.length > 0) {
          column = children.map(ele2 => {
            if (formSubEnCodeList.includes(ele2.prop)) {
              ele2.hide = false;
            }
            else {
              ele2.hide = true;
            }
            if (ele2.hide == false) {
              //工作流中系统表单必填权限
              if (this.formSubTableNotRequiredList && this.formSubTableNotRequiredList[bindTable] !=
                undefined) {
                if (this.formSubTableNotRequiredList[bindTable].includes(ele2.prop)) {
                  ele2.required = false;
                }
                else {
                  ele2.required = true;
                }
              }
              ele2.rules = [];
              if (ele2.required) {
                ele2.rules = ele2.ruleList;
              }
              // disabled 属性
              if (this.formSubTableDisabledList && this.formSubTableDisabledList[bindTable] !=
                undefined) {
                if (this.formSubTableDisabledList[bindTable].includes(ele2.prop)) {
                  ele2.disabled = true;
                }
                else {
                  ele2.disabled = false;
                }
              }
              if (this.disabled) { //查看
                ele2.disabled = true;
              }
            }
            else {
              ele2.rules = []
              if (ele2.required) {
                ele2.ruleList.forEach(el => {
                  el.message += ',' + this.$t('noFormAuth')
                })
                ele2.rules = ele2.ruleList;
              }
            }
            return ele2;
          });
        }
        return column;
      }
      else {
        return children;
      }
    },
    async insertCreatedEvent() {
      //FORM_EVENT_CREATED
    },
    async insertMountedEvent() {
      //FORM_EVENT_MOUNTED
    },
    async insertEditEvent() {
      //FORM_EDIT_STR
    },
    async insertSubmitEvent() {
      //FORM_SUBMIT_STR
    },
    getFormConfig() {
      //FORM_CONFIG_START
      let config = {
        "fields": [{
          "__config__": {
            "label": "产品类型",
            "showLabel": true,
            "labelWidth": null,
            "tag": "el-select",
            "tagIcon": "select",
            "avueType": "select",
            "layout": "colFormItem",
            "span": 24,
            "required": true,
            "regList": [],
            "changeTag": true,
            "dataType": "dataSource",
            "saveField": "F_Id",
            "showField": "F_ModelName",
            "document": "https://element.eleme.cn/#/zh-CN/component/select",
            "F_LgMarkCode": "",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "prestrainField": "",
            "formId": 100,
            "renderKey": "1001720148718796",
            "apiConfig": {
              "url": "",
              "type": "",
              "dataSorce": "",
              "dataSorceList": [],
              "dataSourceFieldOption": [],
              "showField": "",
              "saveField": "",
              "apiInputParams": [],
              "F_UrlAddress": ""
            },
            "dataSource": "80d3178d3eaba4723c100b239d661afe"
          },
          "__slot__": {
            "options": [{
              "label": "写实大模型测试1",
              "value": "3d226874d75378bcf3eb24389d2e3e21"
            }]
          },
          "placeholder": "请选择产品类型",
          "style": {
            "width": "100%"
          },
          "clearable": true,
          "disabled": false,
          "filterable": true,
          "multiple": false,
          "__vModel__": "field100e65e"
        }, {
          "__config__": {
            "label": "关键词",
            "labelWidth": null,
            "showLabel": true,
            "tag": "el-input",
            "tagIcon": "textarea",
            "avueType": "textarea",
            "required": false,
            "layout": "colFormItem",
            "span": 24,
            "regList": [],
            "changeTag": true,
            "document": "https://element.eleme.cn/#/zh-CN/component/input",
            "F_LgMarkCode": "",
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "prestrainField": "",
            "formId": 101,
            "renderKey": "1011720148772815"
          },
          "type": "textarea",
          "placeholder": "请输入关键词（多个以英文逗号分隔）",
          "autosize": {
            "minRows": 4,
            "maxRows": 4
          },
          "style": {
            "width": "100%"
          },
          "maxlength": null,
          "show-word-limit": false,
          "readonly": false,
          "disabled": false,
          "__vModel__": "field10115ed"
        }, {
          "__config__": {
            "label": "生成数量",
            "tag": "el-slider",
            "tagIcon": "slider",
            "avueType": "slider",
            "defaultValue": 1,
            "span": 6,
            "showLabel": true,
            "layout": "colFormItem",
            "labelWidth": null,
            "required": false,
            "changeTag": true,
            "document": "https://element.eleme.cn/#/zh-CN/component/slider",
            "F_LgMarkCode": "",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "prestrainField": "",
            "formId": 102,
            "renderKey": "1021720148813709"
          },
          "disabled": false,
          "min": 1,
          "max": 4,
          "step": 1,
          "show-stops": false,
          "range": false,
          "__vModel__": "field102f7a2"
        }, {
          "__config__": {
            "label": "宽度",
            "tag": "el-slider",
            "tagIcon": "slider",
            "avueType": "slider",
            "defaultValue": 512,
            "span": 10,
            "showLabel": true,
            "layout": "colFormItem",
            "labelWidth": null,
            "required": false,
            "changeTag": true,
            "document": "https://element.eleme.cn/#/zh-CN/component/slider",
            "F_LgMarkCode": "",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "prestrainField": "",
            "formId": 105,
            "renderKey": "1051720148918158"
          },
          "disabled": false,
          "min": 64,
          "max": 2048,
          "step": 1,
          "show-stops": false,
          "range": false,
          "__vModel__": "field105846a"
        }, {
          "__config__": {
            "label": "生成",
            "showLabel": false,
            "changeTag": true,
            "labelWidth": null,
            "isBindTable": false,
            "tag": "avue-custom-button",
            "avueType": "custom-button",
            "tagIcon": "button",
            "span": 8,
            "layout": "colFormItem",
            "triggerEvents": ["click", "clickAfter"],
            "triggerEventData": {
              "click": [],
              "clickAfter": []
            },
            "formId": 107,
            "renderKey": "1071720149032684"
          },
          "btnWidth": "",
          "btnHeight": "",
          "content": "生成",
          "prefix-icon": "el-icon-star-on",
          "suffix-icon": "",
          "type": "primary",
          "__vModel__": "field1076d78"
        }, {
          "__config__": {
            "label": "分辨率",
            "labelWidth": null,
            "showLabel": true,
            "tag": "el-radio-group",
            "tagIcon": "radio",
            "avueType": "radio",
            "changeTag": true,
            "defaultValue": "0",
            "layout": "colFormItem",
            "span": 6,
            "optionType": "button",
            "regList": [],
            "dataType": "dataItem",
            "required": true,
            "border": true,
            "saveField": "",
            "showField": "",
            "document": "https://element.eleme.cn/#/zh-CN/component/radio",
            "F_LgMarkCode": "",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "prestrainField": "",
            "formId": 104,
            "renderKey": "1041720148853686",
            "apiConfig": {
              "url": "",
              "type": "",
              "dataSorce": "",
              "dataSorceList": [],
              "dataSourceFieldOption": [],
              "showField": "",
              "saveField": "",
              "apiInputParams": [],
              "F_UrlAddress": ""
            },
            "dataItem": "ResolvingPower"
          },
          "__slot__": {
            "options": [{
              "label": "普通",
              "value": "0"
            }, {
              "label": "高清",
              "value": "1"
            }]
          },
          "style": {},
          "size": "mini",
          "disabled": false,
          "__vModel__": "field104ed68"
        }, {
          "__config__": {
            "label": "高度",
            "tag": "el-slider",
            "tagIcon": "slider",
            "avueType": "slider",
            "defaultValue": 512,
            "span": 10,
            "showLabel": true,
            "layout": "colFormItem",
            "labelWidth": null,
            "required": false,
            "changeTag": true,
            "document": "https://element.eleme.cn/#/zh-CN/component/slider",
            "F_LgMarkCode": "",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "prestrainField": "",
            "formId": 106,
            "renderKey": "1061720148996760"
          },
          "disabled": false,
          "min": 64,
          "max": 2048,
          "step": 1,
          "show-stops": false,
          "range": false,
          "__vModel__": "field1065b12"
        }, {
          "__config__": {
            "label": "生成",
            "showLabel": false,
            "changeTag": true,
            "labelWidth": null,
            "isBindTable": false,
            "tag": "avue-custom-button",
            "avueType": "custom-button",
            "tagIcon": "button",
            "span": 8,
            "layout": "colFormItem",
            "triggerEvents": ["click", "clickAfter"],
            "triggerEventData": {
              "click": [],
              "clickAfter": []
            },
            "formId": 108,
            "renderKey": "1081720149131337"
          },
          "btnWidth": "",
          "btnHeight": 0,
          "content": "清空",
          "prefix-icon": "el-icon-delete-solid",
          "suffix-icon": "",
          "type": "primary",
          "__vModel__": "field108df02"
        }, {
          "__config__": {
            "label": "分割线",
            "showLabel": false,
            "changeTag": true,
            "isBindTable": false,
            "direction": "horizontal",
            "contentPosition": "",
            "tag": "el-divider",
            "tagIcon": "split-line",
            "top": 0,
            "bottom": 0,
            "span": 24,
            "layout": "colFormItem",
            "document": "https://element.eleme.cn/#/zh-CN/component/divider",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 109,
            "renderKey": "1091720149206382"
          },
          "__slot__": {},
          "__vModel__": "field109ec1a"
        }, {
          "__config__": {
            "label": "方案1",
            "changeTag": null,
            "isBindTable": false,
            "showLabel": false,
            "titlePosition": "center",
            "titleColor": null,
            "fontSize": 15,
            "tag": "h2",
            "tagIcon": "title",
            "span": 6,
            "align": "top",
            "justify": "start",
            "layout": "colFormItem",
            "document": "https://element.eleme.cn/#/zh-CN/component/button",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 110,
            "renderKey": "1101720149277326"
          },
          "__slot__": {},
          "__vModel__": "field110557f"
        }, {
          "__config__": {
            "label": "方案2",
            "changeTag": null,
            "isBindTable": false,
            "showLabel": false,
            "titlePosition": "center",
            "titleColor": null,
            "fontSize": 15,
            "tag": "h2",
            "tagIcon": "title",
            "span": 6,
            "align": "top",
            "justify": "start",
            "layout": "colFormItem",
            "document": "https://element.eleme.cn/#/zh-CN/component/button",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 111,
            "renderKey": "1111720149303913"
          },
          "__slot__": {},
          "__vModel__": "field1117c0b"
        }, {
          "__config__": {
            "label": "方案3",
            "changeTag": null,
            "isBindTable": false,
            "showLabel": false,
            "titlePosition": "center",
            "titleColor": null,
            "fontSize": 15,
            "tag": "h2",
            "tagIcon": "title",
            "span": 6,
            "align": "top",
            "justify": "start",
            "layout": "colFormItem",
            "document": "https://element.eleme.cn/#/zh-CN/component/button",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 118,
            "renderKey": "1181720149438480"
          },
          "__slot__": {},
          "__vModel__": "field1186552"
        }, {
          "__config__": {
            "label": "方案4",
            "changeTag": null,
            "isBindTable": false,
            "showLabel": false,
            "titlePosition": "center",
            "titleColor": null,
            "fontSize": 15,
            "tag": "h2",
            "tagIcon": "title",
            "span": 6,
            "align": "top",
            "justify": "start",
            "layout": "colFormItem",
            "document": "https://element.eleme.cn/#/zh-CN/component/button",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 119,
            "renderKey": "1191720149438880"
          },
          "__slot__": {},
          "__vModel__": "field119af6a"
        }, {
          "__config__": {
            "label": "",
            "showLabel": false,
            "labelWidth": null,
            "tag": "el-image",
            "tagIcon": "image",
            "layout": "colFormItem",
            "span": 6,
            "fit": "",
            "defaultValue": "http://localhost:28281/annexes-files/33b4ae552862fc52a91917f6163a890b",
            "document": "https://element.eleme.cn/#/zh-CN/component/image",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 117,
            "renderKey": "1171720149322816"
          },
          "__vModel__": "field1175c53",
          "style": {
            "width": "100%"
          }
        }, {
          "__config__": {
            "label": "",
            "showLabel": false,
            "labelWidth": null,
            "tag": "el-image",
            "tagIcon": "image",
            "layout": "colFormItem",
            "span": 6,
            "fit": "",
            "defaultValue": "http://localhost:28281/annexes-files/33b4ae552862fc52a91917f6163a890b",
            "document": "https://element.eleme.cn/#/zh-CN/component/image",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 120,
            "renderKey": "1201720149468864"
          },
          "__vModel__": "field1209f91",
          "style": {
            "width": "100%"
          }
        }, {
          "__config__": {
            "label": "",
            "showLabel": false,
            "labelWidth": null,
            "tag": "el-image",
            "tagIcon": "image",
            "layout": "colFormItem",
            "span": 6,
            "fit": "",
            "defaultValue": "http://localhost:28281/annexes-files/33b4ae552862fc52a91917f6163a890b",
            "document": "https://element.eleme.cn/#/zh-CN/component/image",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 121,
            "renderKey": "1211720149469080"
          },
          "__vModel__": "field12155fd",
          "style": {
            "width": "100%"
          }
        }, {
          "__config__": {
            "label": "",
            "showLabel": false,
            "labelWidth": null,
            "tag": "el-image",
            "tagIcon": "image",
            "layout": "colFormItem",
            "span": 6,
            "fit": "",
            "defaultValue": "http://localhost:28281/annexes-files/33b4ae552862fc52a91917f6163a890b",
            "document": "https://element.eleme.cn/#/zh-CN/component/image",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 123,
            "renderKey": "1231720149900832"
          },
          "__vModel__": "field12314e3",
          "style": {
            "width": "100%"
          }
        }]
      };
      return config;
      //FORM_CONFIG_END
    },
    getFormFieldsMap() {
      //FORM_CONFIG_MAP_START
      let config = [
        [100, {
          "__vModel__": "field100e65e",
          "__config__": {
            "avueType": "select",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "autoHandlerConfig": null
          }
        }],
        [101, {
          "__vModel__": "field10115ed",
          "__config__": {
            "avueType": "textarea",
            "triggerEvents": ["blur"],
            "triggerEventData": {
              "blur": []
            },
            "autoHandlerConfig": null
          }
        }],
        [102, {
          "__vModel__": "field102f7a2",
          "__config__": {
            "avueType": "slider",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "autoHandlerConfig": null
          }
        }],
        [105, {
          "__vModel__": "field105846a",
          "__config__": {
            "avueType": "slider",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "autoHandlerConfig": null
          }
        }],
        [107, {
          "__vModel__": "field1076d78",
          "__config__": {
            "avueType": "custom-button",
            "triggerEvents": ["click", "clickAfter"],
            "triggerEventData": {
              "click": [],
              "clickAfter": []
            },
            "autoHandlerConfig": null
          }
        }],
        [104, {
          "__vModel__": "field104ed68",
          "__config__": {
            "avueType": "radio",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "autoHandlerConfig": null
          }
        }],
        [106, {
          "__vModel__": "field1065b12",
          "__config__": {
            "avueType": "slider",
            "triggerEvents": ["change"],
            "triggerEventData": {
              "change": []
            },
            "autoHandlerConfig": null
          }
        }],
        [108, {
          "__vModel__": "field108df02",
          "__config__": {
            "avueType": "custom-button",
            "triggerEvents": ["click", "clickAfter"],
            "triggerEventData": {
              "click": [],
              "clickAfter": []
            },
            "autoHandlerConfig": null
          }
        }],
        [109, {
          "__vModel__": "field109ec1a",
          "__config__": {
            "autoHandlerConfig": null
          }
        }],
        [110, {
          "__vModel__": "field110557f",
          "__config__": {
            "autoHandlerConfig": null
          }
        }],
        [111, {
          "__vModel__": "field1117c0b",
          "__config__": {
            "autoHandlerConfig": null
          }
        }],
        [118, {
          "__vModel__": "field1186552",
          "__config__": {
            "autoHandlerConfig": null
          }
        }],
        [119, {
          "__vModel__": "field119af6a",
          "__config__": {
            "autoHandlerConfig": null
          }
        }],
        [117, {
          "__vModel__": "field1175c53",
          "__config__": {
            "autoHandlerConfig": null
          }
        }],
        [120, {
          "__vModel__": "field1209f91",
          "__config__": {
            "autoHandlerConfig": null
          }
        }],
        [121, {
          "__vModel__": "field12155fd",
          "__config__": {
            "autoHandlerConfig": null
          }
        }],
        [123, {
          "__vModel__": "field12314e3",
          "__config__": {
            "autoHandlerConfig": null
          }
        }]
      ];
      return new Map(config);
      //FORM_CONFIG_MAP_END
    },
    async getHideComponentsMap() {
      let mapList = new Map();
      let hideComponentList = this.getHideComponents();
      if (typeof this.initHideComponentList == 'function') {
        mapList = await this.initHideComponentList(hideComponentList);
        this.$store.commit("SET_HIDE_COMPONENT_LIST", mapList);
      }
      return mapList;
    },
    getHideComponentsMapItem(key) {
      if (this.hideComponentsMap.size > 0) {
        return this.hideComponentsMap.has(key) ? this.hideComponentsMap.get(key) : "";
      }
      else {
        return ""
      }
    },
    getHideComponents() {
      //FORM_HIDE_COMPONENTS_START
      let config = [];
      return config;
      //FORM_HIDE_COMPONENTS_END
    },
  }
}

</script>
<style>
.el-table__empty-block {
  width: 100% !important;
}
.el-image{
	justify-content: center !important;
	display: flex !important;
}

.avue-form__row {
  padding: 0 !important;
}

#editorphone {
  width: 375px;
  margin: 0 auto;
  border: 1px solid #E4E7ED;
  padding: 0 7.5px;
  background: #f5f6fa;
  height: 700px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 5px;
}

#editorphone .el-col {
  border-bottom: 1px solid #F2F2F2;
  background: #fff;
  margin-bottom: 0;
  padding: 0 15px 6px !important;
  width: 100%;
}

#editorphone .el-form-item__label {
  line-height: 20px
}

#editorphone .el-input-group .el-input__inner {
  background: #f5f6fa
}

#editorphone .el-input__inner {
  border: 0
}

#editorphone .el-input-group__append,
#editorphone .el-input-group__prepend {
  border: 0;
  background: #edeef2;
  color: #666;
}

#editorphone .el-input-group .el-input__prefix {
  left: 44px
}

#editorphone .el-input-group .el-input__suffix {
  right: 44px
}

#editorphone .el-form-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-flow: wrap;
}

#editorphone .el-form-item__label {
  float: none;
  min-width: 85px;
  width: auto !important;
  text-align: left;
  flex: auto;
}

#editorphone .tinymce .el-form-item__label {
  min-width: 100%;
}

#editorphone .el-form-item__content {
  margin-left: 0px !important;
  flex: auto;
  width: calc(100% - 95px);
}

#editorphone .avueFormNoLable .el-form-item__label,
#editorphone .avueFormNoLable .avue-crud__pagination {
  display: none;
}

#editorphone .avueFormNoLable .el-collapse-item__wrap,
#editorphone .avueFormNoLable .el-collapse {
  border-bottom: 0
}

#editorphone .avueFormNoLable .el-col {
  border-bottom: 0;
  padding-bottom: 0
}

#editorphone .el-form-item__content .el-button:first-child {
  margin-left: 90px;
}

</style>
